package system_storage_service

import (
	"gitee.com/Luna-CY/Golang-Project-Template/internal/context"
	"gitee.com/Luna-CY/Golang-Project-Template/internal/errors"
	"gitee.com/Luna-CY/Golang-Project-Template/internal/interface/dao"
	"gitee.com/Luna-CY/Golang-Project-Template/model"
)

func (cls *Storage) ListObjectByCondition(ctx context.Context, page int, size int, options ...dao.SystemObjectOption) (int64, []*model.SystemObject, errors.Error) {
	total, data, err := cls.object.FindSystemObjectByCondition(ctx, page, size, options...)
	if err != nil {
		return 0, nil, err.Relation(errors.ErrorServerInternalError("ISS_GE.S_GE.LOBC_CO.131013", "查询对象失败"))
	}

	return total, data, nil
}
